<template>
  <div class="content">
    <div class="aside">
      <el-menu mode="vertical" class="aside-menu" @select="menuRouter">
        <el-menu-item
          v-for="m in dashboardMenuObj"
          :key="m.index"
          :index="m.index.toString()"
        >
          <i :class="m.icon"></i>
          <span slot="title" class="item-title">{{ m.name }}</span>
        </el-menu-item>
      </el-menu>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import '@/assets/module-frame.css'
import { MenuQuery } from '@/utils/MenuController.js'
export default {
  data: function () {
    return {
      dashboardMenuObj: MenuQuery('currentUser', 'dashboard').getData()
    }
  },
  methods: {
    menuRouter(key) {
      this.$router
        .push(this.dashboardMenuObj[key].routerPath)
        .catch((err) => {
          err
        })
    }
  }
}
</script>

<style></style>
